import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBEngineer/YBBaseMarQuee/ace_marquee.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBEngineer/YBBaseRouter/YBApplication.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBEngineer/YBBaseRouter/YBNavigator.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBHelper/YBColor/YBColor.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBHelper/YBImageStyle/YBImageStyle.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBHelper/YBTextStyle/YBTextStyle.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBHelper/yb_chinese_text/yb_chinese_text.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBModule/YBWorkTaiModule/YBFenXiangHuKePage/YBBaseProvider/YBBaseProvider.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBModule/YBWorkTaiModule/YBWorkTaiSubPage/YBWorkTaiHeaderPage.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBModule/YBWorkTaiModule/YBWorkTaiSubPage/YBWorkTaiHuKePage.dart';

class YBWorkTaiSubSPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Container(
      decoration: BoxDecoration(
        color: YBColor.white,
        borderRadius: BorderRadius.circular(YBTextStyle.adapterSize8),
      ),
      child: Padding(
          padding: EdgeInsets.only(top: YBTextStyle.adapterSize16,left: YBTextStyle.adapterSize12,right: YBTextStyle.adapterSize12),
          child: Container(
            child: Column(
              mainAxisAlignment: MainAxisAlignment.start,
              crossAxisAlignment: CrossAxisAlignment.stretch,
              children: [
                Container(
                  child: YBWorkTaiHeaderPage(titleStr: YBChineseText.workTaiFenXingHuKetitle,subTitleStr:YBChineseText.workTaiFenXingHuKeSubtitle,),
                ),
                Container(
                  child:Padding(
                      padding:EdgeInsets.only(top: YBTextStyle.adapterSize24,bottom: YBTextStyle.adapterSize24),
                      child:  YBWorkTaiHuKePage(),
                  ),
                ),
                Container(
                  height: YBTextStyle.adapterSize50,
                  child:Column(
                    children: [
                      Container(
                        color: YBColor.homeBorderLineColor,
                        height: 1,
                      ),
                      Expanded(
                        child: Row(
                          mainAxisAlignment: MainAxisAlignment.start,
                          crossAxisAlignment: CrossAxisAlignment.center,
                          children: [
                            Container(
                              decoration: BoxDecoration(
                                color:YBColor.workTaiGongGaoColor,
                                borderRadius: BorderRadius.all(Radius.circular(YBTextStyle.adapterSize2)),
                              ),
                              child: Padding(
                                  padding: EdgeInsets.only(left: YBTextStyle.adapterSize4,right: YBTextStyle.adapterSize4,top: YBTextStyle.adapterSize2,bottom: YBTextStyle.adapterSize2),
                                  child: Text(YBChineseText.workTaiReMenTitle,style: YBTextStyle.workTaiReMenText,),
                              ),
                            ),
                            Container(
                              width: YBTextStyle.adapterSize8,
                            ),
                            Expanded(
                              child:ChangeNotifierProvider(
                                create: (context) => YBBaseProvider()..getReMenDataList(1, "material_library"),
                                child: Consumer<YBBaseProvider>(
                                    builder: (context,gonggaoList,child){
                                      return InkWell(
                                        child: Container(
                                          height: YBTextStyle.adapterSize44,
                                          child: ACEMarquee(
                                            children: gonggaoList.reMenModelList.map((e){
                                              return Container(
                                                alignment: Alignment.centerLeft,
                                                child: Padding(
                                                  padding: EdgeInsets.only(left: YBTextStyle.adapterSize10,right: YBTextStyle.adapterSize10,bottom: YBTextStyle.adapterSize10,top: YBTextStyle.adapterSize10),
                                                  child: Text(e.title,maxLines: 1,),
                                                ),
                                              );
                                            }).toList()??List(),
                                            direction: AxisDirection.up,
                                            duration: Duration(milliseconds: 2000),
                                          ),
                                        ),
                                        onTap: ()=> YBNavigatorUtil.jump(context,'/workTaiPage/workTaiGonggaoPage?type=3'),
                                      );
                                    }
                                ),
                              ),
                            ),
                            Container(
                              width: YBTextStyle.adapterSize8,
                            ),
                            Container(
                              child: Image.asset(YBImageStyle.getImagePath("findIconArrowRight"),width:YBTextStyle.adapterSize6,height: YBTextStyle.adapterSize10,),
                            ),
                            Container(
                              width: YBTextStyle.adapterSize12,
                            ),
                          ],
                        ),
                      ),
                    ],
                  ),
                ),
              ],
            ),
          ),
      ),
    );
  }
}

